package com.lovo.order.dao;

import com.lovo.order.entity.OrderEntity;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

public interface IOrderDao extends CrudRepository<OrderEntity,Long> {
    //事务
    @Transactional
    //hq
    @Modifying
    @Query("update  OrderEntity set tag=1 where orderNum=?1")
    /**
     * 把编号orderNum的tag设为一
     */
    public int updateOrder(String orderNum);


    //事务
    @Transactional
    //hq
    @Modifying
    @Query("update  OrderEntity set tag=2 where orderNum=?1")
    /**
     * 把编号orderNum的tag设为2
     */
    public int updateOrderTotwo(String orderNum);

    //事务
    @Transactional
    //hq
    @Modifying
    @Query("update  OrderEntity set tag=3 where orderNum=?1")
    /**
     * 把编号orderNum的tag设为3
     */
    public int updateOrderTothree(String orderNum);

}
